<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        function Fn(x, y) {
            let sum = 10;
            this.total = x + y;             
            this.say = function () {
                console.log(`我计算的和是:${this.total}`);
            };
            return "hello";
        }
        let res = Fn(10, 20); //普通函数执行  普通函数没有(),就是函数堆
        let f1 = new Fn(10, 20); //构造函数执行
        let f2=new Fn;//构造函数执行  构造函数没有(),构造函数仍然执行，没传递参数
        console.log(f1.sum); //undefined
        console.log(f1.total); //30 
        console.log(f1.say===f2.say);//false

        // var obj=new Object();
        // console.log(Object)
    </script>
</body>
</html>